package com.jboost.modules.area.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;

/**
 * @Description: csc_category
 * @Author: cxn
 * @Date:   2021-05-11
 * @Version: V1.0
 */
@Data
@TableName("jboost_area")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="area", description="area")
public class JboostArea {

    /** ID */
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "ID")
    private String id;
	/**code*/
	@Excel(name = "code", width = 15)
    @ApiModelProperty(value = "code")
    private String code;
	/**pCode*/
	@Excel(name = "pCode", width = 15)
    @ApiModelProperty(value = "pCode")
    private String pCode;
	/**name*/
	@Excel(name = "name", width = 15)
    @ApiModelProperty(value = "name")
    private String name;
	/**short_name*/
	@Excel(name = "shortName", width = 15)
    @ApiModelProperty(value = "shortName")
    private String shortName;
	/**pinyin*/
	@Excel(name = "pinyin", width = 15)
    @ApiModelProperty(value = "pinyin")
    private String pinyin;
	/**short_pinyin*/
	@Excel(name = "shortPinyin", width = 15)
    @ApiModelProperty(value = "shortPinyin")
    private String shortPinyin;
	@TableField(exist = false)
    private boolean hasChild = false;

	public boolean getHasChild(){
	    if (null == this.code)return false;
	    return "0".equals(this.code.substring(this.code.length()-1));
    }
}
